Release 10.1A: OpenEdge Development:
Programming Interfaces
Designing an interface for viewing report data
In contrast to the Progress-controlled interface you saw in the last example, here’s what you need to create a user-controlled report viewing interface:
- A dialog box to contain the output. Therefore, you won’t need to leave room on your main display for the report data.
- An OK button in the dialog box to let the user dismiss the report.
- A temporary file to contain the report data. Having the control block output to a temporary file eliminates the pausing behavior.
- An editor widget with scrollbars to read the file into. The scrollbars let the user navigate the report in two directions.
The next example creates a dialog box interface for the same report you saw in the last example. The notes that follow the exercise explain the new code techniques you need to make this interface work.
![]()
To create a dialog box interface for the report in Windows:
Here is the code for this example:
These notes explain the new code techniques used in this example:
- This editor is for the report data.
- The
OUTPUT TOstatement is your tool for directing output. This example directs output to the named file. This chapter covers directing output more fully in a later section.- This
FOR EACHuses the default down frame, and theSTREAM-IOoption reduces all widgets to textual data without decorations. Using theSTREAM-IOoption is a requirement when outputting to any destination other than the screen.- Once you direct output to a destination, you need to close the output stream to return output to the default destination, which is the screen.
- This
ASSIGNstatement manipulates three editor attributes and one method to set up the dialog box. TheREAD-ONLYattribute prevents changes to the report content. TheSENSITIVEattribute enables the editor, making the scrolling functions available. TheTITLEattribute contains the dialog box title text. TheREAD-FILEmethod takes a valid filename and returnsYESorNOto indicate if Progress successfully read the file contents into the editor.- You only want to bring up the dialog box if the logical variable stat equals
YES, which means that Progress successfully read the file into the editor.- If you use a
WAIT-FORstatement in a dialog box, you must use theHIDEstatement to dismiss the dialog box.- On all platforms that Progress supports, the output font designated by 3 is always a monospaced font, which are frequently used in printed reports. Assigning this font makes the editor contents mimic a printed report.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |